Page({


  data: {
    colorStates: null,
    img: null,
    textTitle: '正在加载请稍后...',
    textContent: '',
    cTime: null,
    cChooseId: null

  },
  onLoad: function (options) {
    var that = this
    console.options
    var _states = options.state
    var _course = options.course
    var _cTime = options.cTime
    console.log(_states)
    that.setData({
      cChooseId: _course,
      cTime: _cTime
    })
    if (_states == 0) {
      that.setData({
        colorStates: false,
        img: '../../images/false.png',
        textTitle: "签到失败",
        textContent: "同学你离教室太远了哦"
      })
    } else if (_states == 2) {
      that.setData({
        colorStates: false,
        img: '../../images/false.png',
        textTitle: "签到失败",
        textContent: "同学你超出签到时间范围了哦"
      })
    } else {
      that.setData({
        colorStates: true,
        img: '../../images/right3.png',
        textTitle: "签到成功",

      })
    }
  },
  back() {
    wx.redirectTo({
      url: "../index/index"
    })
  },
  onReady: function () {

  },

  onShow: function () {

  },
  onHide: function () {

  },

})